package com.gameapplet.user.service.Impl;

import com.gameapplet.user.dao.IUserDao;
import com.gameapplet.user.model.User;
import com.gameapplet.user.service.IUserService;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service("userService")
public class UserServiceImpl implements IUserService {
    @Resource(name="iUserDao")
    private IUserDao iUserDao;

    @Override
    public List<User> selectUser() throws Exception {
        return this.iUserDao.selectUser();
    }

    @Override
    public User getUserById(String openid) {

        return   iUserDao.selectUserById(openid);
    }

    @Override
    public void insertUser(User user) {
       iUserDao.insertUser(user);
    }

    @Override
    public void updateUser(User user) {
        iUserDao.updateUser(user);
    }

    @Override
    public Integer selectMaxStage() {
        return iUserDao.selectMaxStage();
    }

    @Override
    public void insertGroup(String opengid,String openid) {
      iUserDao.insertGroup(opengid,openid);
    }
    public User selectGroupById(String opengid,String openid){
        return iUserDao.selectGroupById(opengid,openid);
    }
}
